// 屏幕适配 mixin 函数
export default {
  mounted() {
    this.setautoSize()
    window.onresize = () => {
      //调用methods中的事件
      this.setautoSize()
    }
  },
  beforeDestroy() {
    window.removeEventListener('resize', this.setautoSize());
  },
  methods: {
    setautoSize() {
      const scaleRef = this.$refs["scaleRef"]
      if (!scaleRef) return 
      scaleRef.style = `transform:scale(${window.innerWidth / 1920},${window.innerHeight / 1080});overflow: hidden; width: 1920px;height:1080px;transform-origin: left top 0px;`
    },
  },
}